From: Florian Müllner Date: Fri, 1 Sep 2023 01:40:10 +0000 (+0200) Subject: tools/toolbox: Allow to set new toolbox as default for other tools X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~2^2~272 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5998036dc2bbf60720fcdc13f1e72045ff558f2b;p=gnome-shell.git tools/toolbox: Allow to set new toolbox as default for other tools When specified, write out a small config file that can be sourced by other scripts to pick the default toolbox container. Part-of: --- diff --git a/tools/toolbox/create-toolbox.sh b/tools/toolbox/create-toolbox.sh index 0294719af..1b2ab9bbd 100755 --- a/tools/toolbox/create-toolbox.sh +++ b/tools/toolbox/create-toolbox.sh @@ -5,6 +5,7 @@ set -e TOOLBOX_IMAGE=registry.gitlab.gnome.org/gnome/gnome-shell/toolbox DEFAULT_NAME=gnome-shell-devel +CONFIG_FILE=${XDG_CONFIG_HOME:-$HOME/.config}/gnome-shell-toolbox-tools.conf usage() { cat <<-EOF @@ -22,6 +23,8 @@ usage() { -b, --builder Set up GNOME Builder configuration --locales=LOCALES Enable support for additional locales LOCALES --skip-mutter Do not build mutter + --set-default Set as default for other gnome-shell + toolbox tools -h, --help Display this help EOF @@ -76,6 +79,11 @@ setup_classic() { https://gitlab.gnome.org/GNOME/gnome-shell-extensions.git $branch } +set_default() { + mkdir -p $(dirname $CONFIG_FILE) + echo DEFAULT_TOOLBOX=$NAME > $CONFIG_FILE +} + TEMP=$(getopt \ --name $(basename $0) \ --options 'n:v:rcbh' \ @@ -86,6 +94,7 @@ TEMP=$(getopt \ --longoptions 'builder' \ --longoptions 'locales:' \ --longoptions 'skip-mutter' \ + --longoptions 'set-default' \ --longoptions 'help' \ -- "$@") @@ -127,6 +136,11 @@ while true; do shift ;; + --set-default) + SET_DEFAULT=1 + shift + ;; + --locales) IFS=" ," LOCALES+=($2) shift 2 @@ -161,3 +175,4 @@ install_extra_packages [[ $SETUP_CLASSIC ]] && setup_classic [[ $SETUP_BUILDER ]] && create_builder_config +[[ $SET_DEFAULT ]] && set_default